#define D2D_INPUT_COUNT 1
#define D2D_INPUT1_SAMPLEX

#include "d2d1effecthelpers.hlsli"

float innerCircleRadius =0.3;

D2D_PS_ENTRY(main){

    //获取当前像素在屏幕上的坐标（相对位置）
    float2 pos= D2DGetInputCoordinate(0).xy;
    float high = (1-innerCircleRadius*2)/2;
    float dx = pos.x-0.5;
    float dy = pos.y-0.5;
    
    float theta = atan2(-dy,-dx);
    float radius = length(float2(dx,dy));
    theta = theta %(2*3.1415);

    float tx = theta/(3.1415+0.0001);
    float ty = 1-(radius-innerCircleRadius)/ (high+0.000001);
    //按百分比进行采样
    return  D2DSampleInput(0,float2(tx,ty));
}